<!DOCTYPE html> 
<html lang="en"> 
<head> 
    <meta charset="utf-8"> 
    <meta name="viewport" content="width=device-width, initial-scale=1"> 
    <title>提取物品</title> 
    <link href="css/base.css" rel="stylesheet">
    <link rel="stylesheet" type="text/css" href="jquery-easyui-1.5.3/themes/bootstrap/easyui.css">
    <link href="jquery-easyui-1.5.3/themes/icon.css" rel="stylesheet">
    <link href="css/basic_info.css" rel="stylesheet">
    <link rel="stylesheet" href="css/xk.css">
    <script type="text/javascript" src="font_jjkmvgsdpk/iconfont.js"></script>
    <link rel="stylesheet" href="font_jjkmvgsdpk/iconfont.css">
    <link href="css/process.css" rel="stylesheet">
</head> 
<body>
 <div class="container">
  <div class="content">
    <div class="easyui-panel" id="query-data" style="padding:1px;width: 100%;">
      <table id="dataGrid" ></table>
    </div>
  </div>  
 </div>
<div id="add_glxc" class="easyui-dialog" closed="true">
 <table class="xk_table">
   <tr>
     <td class="xk_dialog_label">
      <button class="easyui-linkbutton" id="sswp_add_btn" type="button" iconCls="icon-search">勘验号</button>   
     </td>
     <td class=""><input type="text" class="xk_dialog_input"></td>  
   </tr>  
 </table> 
</div>
<div id="add_tqwp" class="easyui-dialog" closed="true">
 <table class="xk_table">
  <tr>
   <td class="xk_label">序号</td>
   <td><input type="text" value="1" class="xk_input" name="" style="width: 90%;"></td>
   <td class="xk_label">物品名称<font>*</font></td>
   <td><input type="text" class="xk_input" name="" style="width: 90%;"></td>
   <td class="xk_label">提取部位<font>*</font></td>
   <td><input type="text" class="xk_input" name="" style="width: 90%;"></td>
  </tr>
  <tr>
   <td class="xk_label">提取方法<font>*</font></td>
   <td><input type="text" class="xk_input" name="" style="width: 90%;"></td>
   <td class="xk_label">提取人<font>*</font></td>
   <td><input type="text" class="xk_input" id="tqr_val" readonly="readonly" key="" name="" style="width: 90%;">
    <svg class="icon" aria-hidden="true" id="tqr">
     <use xlink:href="#icon-shujuzidian"></use>
    </svg>
   </td>
   <td class="xk_label">提取数量</td>
   <td><input type="text" class="xk_input" name="" style="width: 90%;"></td>
  </tr>
  <tr>
   <td class="xk_label">提取日期</td>
   <td><input type="text" class="xk_input" name="" style="width: 90%;"></td>
   <td class="xk_label">基本特征</td>
   <td colspan="3"><input type="text" class="xk_input" name="" style="width: 90%;">
   </td>
  </tr>
  <tr>
    <td class="xk_label_textarea">备注</td>
    <td colspan="5"><textarea type="text" class="xk_input_textarea" name=""></textarea></td>
  </tr>
 </table>
</div>
<!-- 提取人树 -->
<div id="div_tqr_tree" class="easyui-dialog" closed="true">
 <ul id="tqr_tree" style="width: 50%;float: left;margin-top: 1px;"></ul>
 <ul style="width: 50%;float: right;margin-top: 4px;" id="ul_tqr_chanyong">
   <li key="0">常用项</li>
 </ul>
</div>     
</body>
<script type="text/javascript" src="jquery-easyui-1.5.3/jquery.min.js"></script>
<script type="text/javascript" src="jquery-easyui-1.5.3/jquery.easyui.min.js"></script>
 <script type="text/javascript">
      var datagrid = $("#dataGrid").datagrid({
      title : "提取物品列表",
      nowrap : false,
      border : false,
      locale : "zh_CN",
      width:'100%',
      iconCls : 'icon-save',
      striped : true,
      collapsible : true,
      //url : "${ctx}/sysLog/querySysLogList",
      data:[{'xuhao':'00001','wzmc':'K5000000000002019030019','tqbw':'2019-04-20','sl':'长沙市岳麓区','tqr':'长沙市岳麓区','tqrq':'长沙市岳麓区西中心','cljg':'长沙市岳麓区','wzbh':'长沙市岳麓区','wtqk':'长沙市岳麓区西中心','Excel':'Excel'},
      {'xuhao':'00001','wzmc':'K5000000000002019030019','tqbw':'2019-04-20','sl':'长沙市岳麓区','tqr':'长沙市岳麓区','tqrq':'长沙市岳麓区西中心','cljg':'长沙市岳麓区','wzbh':'长沙市岳麓区','wtqk':'长沙市岳麓区西中心','Excel':'Excel'},
      {'xuhao':'00001','wzmc':'K5000000000002019030019','tqbw':'2019-04-20','sl':'长沙市岳麓区','tqr':'长沙市岳麓区','tqrq':'长沙市岳麓区西中心','cljg':'长沙市岳麓区','wzbh':'长沙市岳麓区','wtqk':'长沙市岳麓区西中心','Excel':'Excel'},
      {'xuhao':'00001','wzmc':'K5000000000002019030019','tqbw':'2019-04-20','sl':'长沙市岳麓区','tqr':'长沙市岳麓区','tqrq':'长沙市岳麓区西中心','cljg':'长沙市岳麓区','wzbh':'长沙市岳麓区','wtqk':'长沙市岳麓区西中心','Excel':'Excel'}
     ],
      pagination : true,//表示在datagrid设置分页              
      rownumbers : true,
      //singleSelect : true,
      //
      //        警综关联 
      columns : [ [ 
      { field : 'xuhao',
        title : '序号',
        width : '4%',
        align : 'center' 
      }, {
        field : 'wzmc',
        title : '物证名称',
        width : '10%',
        align : 'center'
      }, {
        field : 'tqbw',
        title : '提取部位',
        width : '10%',
        align : 'center'
      }, {
        field : 'sl',
        title : '数量',
        width : '6%',
        align : 'center'
      },{
        field : 'tqr',
        title : '提取人',
        width : '7%',
        align : 'center'
      } , {
        field : 'tqrq',
        title : '提取日期',
        width : '10%',
        align : 'center'
      }
      , {
        field : 'cljg',
        title : '处理结果',
        width : '15%',
        align : 'center'
      }, {
        field : 'wzbh',
        title : '物证编号',
        width : '15%',
        align : 'center'
      }
      , {
        field : 'wtqk',
        title : '委托情况',
        width : '14%',
        align : 'center'
      } , {
        field : 'Excel',
        title : 'Excel导出',
        width : '5%',
        align : 'center'
      }
      ] ],
          toolbar:[          //工具条  
                {text:"建库",iconCls:"icon-large-chart",handler:function(){//回调函数  
                }},
                {text:"移交",iconCls:"icon-large-shapes",handler:function(){//回调函数  
                }},
                {text:"归还",iconCls:"icon-large-smartart",handler:function(){//回调函数  
                }},
                {text:"销毁",iconCls:"icon-clear",handler:function(){//回调函数  
                }},
                {text:"新增",iconCls:"icon-add",handler:function(){//回调函数 
                  $("#add_tqwp").dialog({
                     title:"新增提取物品基本信息",
                     width:"1200px",
                     height:"260px",
                     closed: false,
                       buttons:[
                      {
                      text:"保存",
                      iconCls:"icon-redo",
                      handler:function(){
                       $("#add_tqwp").dialog("close");
                      }
                      },{
                      text:"保存并提交",
                      iconCls:"icon-save",
                      handler:function(){
                       $("#add_tqwp").dialog("close");
                      }
                      },{
                      text:"取消",
                      iconCls:"icon-cancel",
                      handler:function(){
                       $("#add_tqwp").dialog("close");
                      }
                      }
                      ],
                   });
                     $('#add_tqwp').dialog('open'); //打开添加对话框
                     $('#add_tqwp').window('center');//使Dialog居中显示 
                }},
                {text:"删除",iconCls:"icon-cancel",handler:function(){//回调函数  
                }},
                {text:"排序",iconCls:"icon-redo",handler:function(){//回调函数  
                }},
                 {text:"物证保管",iconCls:"icon-large-clipart",handler:function(){//回调函数  
                }},
                 {text:"生物物证详细导出",iconCls:"icon-large-picture",handler:function(){//回调函数  
                }},
                {text:"修改",iconCls:"icon-edit",handler:function(){  
                }}
         ], 
                //height : $("#query-data").height() - 5,
    });

    //分页处理
    $("#dataGrid").datagrid("getPager").pagination({
      pageSize : 10,
      pageNumber : 1,
      pageList : [ 10, 20, 30, 40, 50 ],
      beforePageText : '第',//页数文本框前显示的汉字   
      afterPageText : '页    共 {pages} 页',
      displayMsg : '当前显示 {from} - {to} 条记录  共 {total} 条记录',
    });
var tqr_val;
$("#tqr").click(function(){
 $("#div_tqr_tree").dialog({
  title:"提取人单选字典",
  width:"700px",
  height:"400px",
  closed: false,
  buttons:[
  {
  text:"选择空值",
  iconCls:"icon-redo",
  handler:function(){
   $("#tqr_val").val("");
   $("#div_tqr_tree").dialog("close");
  }
  },{
  text:"设为常用",
  iconCls:"icon-save",
  handler:function(){
    if(tqr_node != null && tqr_node.length != 0){
      var li_num = $("#ul_tqr_chanyong li").length
      var lis = "";
      for(var i = 0;i<li_num;i++){
        lis += $("#ul_tqr_chanyong li:eq("+i+")").attr("key");
      }
      var tqr_Id = tqr_id.toString();
       if(lis.indexOf(tqr_Id) < 0){
       $("#ul_tqr_chanyong").append("<li key='"+tqr_id+"' ondblclick='tqr_changyong_val(this)'><button class='easyui-linkbutton' onclick='tqr_changyong_del(this)' type='button' iconCls='icon-cancel'></button>"+
        "<a href='javascript:;'>"+tqr_node+"</a></li>");
        $.parser.parse("#ul_tqr_chanyong");
     }
    }
  }
  }
  ],
 });
  $('#div_tqr_tree').dialog('open'); //打开添加对话框
$('#div_tqr_tree').window('center');//使Dialog居中显示
});
//提取人树
var tqr_node;
var tqr_id;
$("#tqr_tree").tree({
  url:'json/xczhry_tree.json',
    method:"get",
  onLoadSuccess:function(){  
   $("#tqr_tree").tree("collapseAll");  
  },
  onDblClick: function(node){
  if($('#tqr_tree').tree('isLeaf',node.target)){
     $("#tqr_val").val(node.text);
     $("#tqr_val").attr("key",node.id);
     $("#div_tqr_tree").dialog("close");
  }
 },
 onClick: function(node){
   if($('#tqr_tree').tree('isLeaf',node.target)){
      tqr_node = node.text;
      tqr_id = node.id;
  }
 }
});
//删除提取人常用项
function tqr_changyong_del(obj){
 $.messager.confirm("操作提示","确定要删除该常用项吗？",function (data){
  if(data){
   obj.parentNode.remove();
  }
 });
}
//给提取人框赋选定常用值
function tqr_changyong_val(obj){
 $("#tqr_val").val(obj.innerText);
 $("#tqr_val").attr("key",obj.attributes.key.value);
 $("#div_tqr_tree").dialog("close");
}      
 </script>
</html>